home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
CAD
/
LISP04.ARJ
/
BLOCKS.LSP
< prev
next >
Wrap
Text File
|
1990-02-09
|
1KB
|
21 lines
;Autocad block documentation routine by AL SCHEIB
;Compuserve [76100,1630]
;This routine writes the names of all blocks defined within a .dwg
;to a text file named using the "dwgname" (variable).txt
(defun C:BLOCKS (/ count file fyle blkname blist)
(setq COUNT 0)
;use the following line of code instead of the one following IT
;to write to a filename other than "dwgname".txt
;(setq file (open (setq fyle (getstring "\nWrite to filename: ")) "w"))
(setq FILE (open (setq FYLE (strcat (getvar "dwgname") ".txt") "w"))
(setq BLIST (tblnext "BLOCK" t)) ;GET FIRST BLOCK IN DATABASE
(WHILE (BOUNDP 'BLIST) ;WHILE not END OF BLOCK TABLE
(SETQ BLKNAME (cdr (assoc 2 BLIST))) ;GET BLOCK NAME
(write-line BLKNAME);print it to the screen
(setq COUNT (+ COUNT 1))
(if (/= "*" (substr blkname 1 1))(write-line blkname file)) ;if it's not a hatch
(setq BLIST (tblnext "BLOCK" ))) ;GET NEXT BLOCK IN DATABASE; END LOOP
(princ COUNT)(princ " block names written to filename: '")(princ FYLE)(prin1 "'")
(close file)
) ;end blocks